#define _CRT_SECURE_NO_WARNINGS 1

#include<stdio.h>

#include<stdlib.h>

int fun(int n, int f[]) {
    if (n == 0) {
        return 7;
    }
    else if (n == 1) {
        return 11;
    }
    else {
        int a = 7, b = 11;
        for (int i = 2; i <= n; i++) {
            f[i] = a + b;
            a = b;
            b = f[i];
        }
    }
    return f[n];
}
int main() {
    int n, k;
    int* f = (int*)malloc(1000000 * sizeof(int));
    f[0] = 7;
    f[1] = 11;
    while (scanf("%d", &n) != EOF) {
        if (n == 0) {
            break;
        }
        else {
            k = fun(n, f);
            if (k % 3 == 0) {
                printf("yes\n");
            }
            else {
                printf("no\n");
            }
        }
    }
    return 0;
}
